//
//  JYPayResultFailView.m
//  JYFarm
//
//  Created by 花花 on 2017/10/30.
//  Copyright © 2017年 花花. All rights reserved.
//

#import "JYPayResultFailView.h"


@interface JYPayResultFailView()

@property(nonatomic)UIView *payFailView; //订单支付未成功View

@property(nonatomic)UIButton *payFailBtn; //订单支付未成功

@property(nonatomic)UIButton *againPayBtn; //重新支付

@property(nonatomic)UIButton *checkOrderBtn; //查看订单



@end
@implementation JYPayResultFailView

- (instancetype)initWithFrame:(CGRect)frame{

    if (self = [super initWithFrame:frame]) {
       
        [self setupSubView];
    }
    
    return self;
}

- (void)setupSubView{

    self.payFailView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width, 110)];

    [self addSubview:self.payFailView];

    self.payFailBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.payFailBtn.frame = CGRectMake(0, 0, Screen_Width, 25);
    self.payFailBtn.center =self.payFailView.center;
    [self.payFailBtn setImage:[UIImage imageNamed:@"shopping_cart_select_click"] forState:UIControlStateNormal];
    [self.payFailBtn setTitle:@"订单支付未成功" forState:UIControlStateNormal];
 
    [self.payFailView addSubview:self.payFailBtn];
    
    self.againPayBtn = [UIButton jy_buttontitle:@"重新支付" titleColor:[UIColor whiteColor] frame:CGRectMake(10, CGRectGetMaxY(self.payFailView.frame)+30, Screen_Width-20, kBtnHeight) target:self action:@selector(againPayOnClick) fontSize:17 bgImageName:@"login_button_background"];
    [self addSubview:self.againPayBtn];

    
    self.checkOrderBtn = [UIButton jy_buttontitle:@"查看订单" titleColor:kThemeColor frame:CGRectMake(10, CGRectGetMaxY(self.againPayBtn.frame)+10, Screen_Width-20, kBtnHeight) target:self action:@selector(checkOrderOnClick) fontSize:17 bgImageName:@"login_button_background2"];
    [self addSubview:self.checkOrderBtn];
    

}



- (void)againPayOnClick{

    if (_AgainPayBtnHander) {
        _AgainPayBtnHander();
    }

}

- (void)checkOrderOnClick{

    if (_CheckOrderBtnHander) {
        _CheckOrderBtnHander();
    }

}
@end
